package org.apache.catalina.util;

public class Introspection {
	private Introspection() {
		
	}

	
	/**
     * Attempt to load a class using the given Container's class loader. If the class cannot be loaded, a debug level
     * log message will be written to the Container's log and null will be returned.
     *
     * @param context   The class loader of this context will be used to attempt to load the class
     * @param className The class name
     *
     * @return the loaded class or <code>null</code> if loading failed
     */
    public static Class<?> loadClass(ClassLoader cl,String className) {
        Class<?> clazz = null;
        try {
            clazz = cl.loadClass(className);
        } catch (ClassNotFoundException | NoClassDefFoundError | ClassFormatError e) {
            e.printStackTrace();
        } catch (Throwable t) {
            t.printStackTrace();
        }
        return clazz;
    }
	
}
